home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 19 / CU Amiga Magazine's Super CD-ROM 19 (1998)(EMAP Images)(GB)[!][issue 1998-02].iso / CUCD / Programming / LEDA / source / src / plane / _misc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  619 b   |  35 lines

  1. /*******************************************************************************
  2. +
  3. +  LEDA  3.1c
  4. +
  5. +
  6. +  _misc.c
  7. +
  8. +
  9. +  Copyright (c) 1994  by  Max-Planck-Institut fuer Informatik
  10. +  Im Stadtwald, 6600 Saarbruecken, FRG     
  11. +  All rights reserved.
  12. *******************************************************************************/
  13.  
  14.  
  15. #include <LEDA/plane.h>
  16. #include <math.h>
  17.  
  18. line p_bisector(const point& p, const point& q)
  19. { line l(p,q);
  20.   double m_x = (p.xcoord() + q.xcoord())/2;
  21.   double m_y = (p.ycoord() + q.ycoord())/2;
  22.   point M(m_x,m_y);
  23.  
  24.   double alpha = l.angle();
  25.  
  26.   return line(M,alpha+M_PI_2);
  27.  
  28. }
  29.  
  30.  
  31.  
  32.  
  33.   
  34.